package scaffold;

import java.awt.geom.Point2D;

/**
 *
 * @author Mikael Köhlmyr | mikael@kohlmyr.com | http://www.kmyr.net
 */
public class Edge {
        Object p, q;
        
        public Edge(Vertex p, Vertex q){
                this.p = p;
                this.q = q;
        }
        
        public Edge(Point2D.Double p, Point2D.Double q){
                this.p = p;
                this.q = q;
        }

        public Vertex getp3D() {
                if(this.p instanceof Vertex)
                        return (Vertex)p;
                return null;
        }
        
        public Point2D.Double getp2D() {
                if(this.p instanceof Point2D.Double)
                        return (Point2D.Double)p;
                return null;
        }

        public void setp2D(Object p) {
                this.p = p;
        }

        public Vertex getq3D() {
                if(this.q instanceof Vertex)
                        return (Vertex)q;
                return null;
        }
        
        public Point2D.Double getq2D() {
                if(this.q instanceof Point2D.Double)
                        return (Point2D.Double)q;
                return null;
        }

        public void setq2D(Object q) {
                this.q = q;
        }
}
